package com.chen.service.impl;

import com.chen.enums.MatchStrategy;
import com.chen.match.MatchServiceFactory;
import com.chen.model.Order;
import com.chen.model.OrderBooks;
import com.chen.service.MatchService;
import lombok.extern.java.Log;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;

/**
 * 处理限价交易业务
 * @Author: chen
 * @Date: 2021/5/24 4:01 PM
 * @Version 1.0
 */
@Service
@Log
public class LimitPriceMatchServiceImpl implements MatchService, InitializingBean {

    @Override
    public void match(OrderBooks books, Order order) {

        //todo 进行撮合
        log.info("开始撮合");

    }

    @Override
    public void afterPropertiesSet() throws Exception {
        MatchServiceFactory.addMatchService(MatchStrategy.LIMIT_PRICE,this);
    }
}
